package com.ag.zhh.vo;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.ag.bean.TbUrealGroup;


@Entity
@Table(name = "TB_USER", schema = "dbo")
public class UserDeptContact {
	private String UId;
	private Set<UserDept> userChargeDepts;//负责部门
	private String UName;
	private String UFax;
	private String UTel;
	private String UPhone;
	private String UMail;
	private TbUrealGroup group;		//虚拟组
	private String oacode;				//oa编号
	private Set<UserDept> userDepts = new HashSet<UserDept>(0);
	
	@Id
	@Column(name = "U_ID", unique = true, nullable = false, length = 50)
	public String getUId() {
		return this.UId;
	}

	public void setUId(String UId) {
		this.UId = UId;
	}
	
	@Column(name = "U_NAME", nullable = false, length = 50)
	public String getUName() {
		return this.UName;
	}
	public void setUName(String UName) {
		this.UName = UName;
	}
	
	@Column(name = "OA_CODE", nullable = false, length = 50)
	public String getOacode() {
		return oacode;
	}

	public void setOacode(String oacode) {
		this.oacode = oacode;
	}


	
	@Column(name = "U_FAX", length = 20)
	public String getUFax() {
		return this.UFax;
	}

	public void setUFax(String UFax) {
		this.UFax = UFax;
	}

	@Column(name = "U_TEL", length = 20)
	public String getUTel() {
		return this.UTel;
	}

	public void setUTel(String UTel) {
		this.UTel = UTel;
	}

	@Column(name = "U_PHONE", length = 12)
	public String getUPhone() {
		return this.UPhone;
	}

	public void setUPhone(String UPhone) {
		this.UPhone = UPhone;
	}

	@Column(name = "U_MAIL", length = 32)
	public String getUMail() {
		return this.UMail;
	}

	public void setUMail(String UMail) {
		this.UMail = UMail;
	}
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUser")
	public Set<UserDept> getUserChargeDepts() {
		return this.userChargeDepts;
	}

	public void setUserChargeDepts(Set<UserDept> userChargeDepts) {
		this.userChargeDepts = userChargeDepts;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbUsers")
	public Set<UserDept> getTbUserDepts() {
		return this.userDepts;
	}

	public void setTbUserDepts(Set<UserDept> tbUserDepts) {
		this.userDepts = tbUserDepts;
	}

}
